<?php
session_start();
$cdnUrl='./';
//$cdnUrl='http://lin.mei94.com/hisense-card/';
  
//http://hisense.mei94.com/

?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>品质家电 焕新盛典</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<style>
html,body{width:100%;font-size:12px;font-family:Helvetica,Tahoma, Arial, STXihei,Microsoft YaHei, Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;}
body{-webkit-overflow-scrolling: touch;overflow-scrolling: touch;overflow-y: scroll;}
body, div{padding:0px;margin:0px auto;max-width:750px;}
.weui-dialog{position:fixed;z-index:5000;width:80%;max-width:300px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FFF;text-align:center;border-radius:3px;overflow:hidden}.weui-dialog__hd{padding:1.3em 1.6em .5em}.weui-dialog__title{font-weight:400;font-size:36px}.weui-dialog__bd{padding:0 1.6em .86em;min-height:40px;font-size:15px;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.weui-dialog__bd:first-child{padding:1.2em 20px .1em;color:#353535}.weui-dialog__ft{position:relative;line-height:48px;font-size:18px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3CC51F;text-decoration:none;-webkit-tap-highlight-color:transparent;position:relative}.weui-dialog__btn:active{background-color:#EEE}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:#353535}.weui-dialog__btn_primary{color:#0BB20C}@media screen and (min-width:1024px){.weui-dialog{width:35%}}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,.6)}
.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
.js_dialog{display:none;}
-webkit-touch-callout:none;
-webkit-user-select:none;
html{-ms-touch-action:none;}
div,img{-webkit-tap-highlight-color:rgba(0,0,0,0);}
*{-webkit-text-size-adjust: none;}
.simg{position:absolute;display:block;}
a{text-decoration:none;}
.txt{position:absolute;text-indent:4px;color:#787c7f;font-size:12px;z-index:2;border:none;background:transparent;}
.txt::-webkit-input-placeholder{text-align:left;color:#a2a2a2;}
select{position:absolute;color:#787c7f;display:block;background:transparent;border:0px;text-indent:4px;font-size:12px;-webkit-appearance:none;}
.container{position:relative;width:100%;height:auto;}
.page{position:absolute;width:100%;height:100%;display:none;top:0;left:0;}
.home{position:absolute;width:100%;height:100%;top:0;left:0;opacity:0;}
.haitu{position:relative;width:100%;height:auto;margin:0;display:block;} 
.p2-biao{position:absolute;width:100%;left:0;}
#citybody{position:absolute;width:100%;}
.p2-bao{}
</style></head>
<body>
<div class="container">
    <div class="home">
       <img class="home-t1 haitu" src="<?php echo $cdnUrl; ?>img/t1.jpg" />
       <img class="home-t2 haitu" src="<?php echo $cdnUrl; ?>img/t2.jpg" />
    </div>
    
    <div class="p2 page">
       <img class="haitu" src="<?php echo $cdnUrl; ?>img/p2-1.jpg" />
       <img class="haitu" src="<?php echo $cdnUrl; ?>img/p2-2.jpg" />
       <img class="haitu" src="<?php echo $cdnUrl; ?>img/p2-3.jpg" /> 
       
       <div class="p2-bao"></div>
       
       <div class="p2-biao">
          <input id="u-phone" class="txt" name="phone" type="number" />
          <input id="u-name" class="txt" name="name" type="text" />
          <div id="citybody">
              <select class="prov" id="sheng"></select>
              <select class="city" id="shi"></select>
          </div>
          <div class="u-submit simg"></div>
       </div>
    
    </div>
    
    <div class="js_dialog">
       <div class="weui-mask"></div>
       <div class="weui-dialog">
                <div class="weui-dialog__bd weui-msg"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary weui-btn">知道了</a>
                </div>
        </div>
     </div>
	  
</div>
<script src="http://mat1.gtimg.com/libs/jquery2/2.1.4/jquery2.min.js"></script>
<script src="<?php echo $cdnUrl ?>js/pxloader-images.min.js"></script>
<script src="<?php echo $cdnUrl ?>js/jquery.cityselect.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
var _img=['t1.jpg'];
var loader = new PxLoader();
for(var i=0; i<_img.length; i++){loader.addImage('<?php echo $cdnUrl; ?>img/'+_img[i]);}
loader.start();
loader.addCompletionListener(function(e){
	   $('.home').css({"opacity":1});
	   $(".p2").fadeIn(); 
});
$(function(){
	$('.container').width(sWidth);
	$('.p2-biao').height(_rate*427).css({"top":_rate*1920});
	$('#u-phone').width(_rate*680).height(_rate*72).css({"top":0, "left":_rate*34,'line-height':_rate*72+'px'});
	$('#u-name').width(_rate*680).height(_rate*72).css({"top":_rate*112, "left":_rate*34,'line-height':_rate*72+'px'});
	
	$('#citybody').height(_rate*72).css({"top":_rate*220});
	
	$('#sheng').width(_rate*298).height(_rate*72).css({"top":0, "left":_rate*34,'line-height':_rate*72+'px'});
	$('#shi').width(_rate*298).height(_rate*72).css({"top":0, "left":_rate*420,'line-height':_rate*72+'px'});

	$('.u-submit').width(_rate*690).height(_rate*110).css({"top":_rate*340, "left":_rate*30});

	
	
	$("#citybody").citySelect({
		nodata:"none",
		required:false
	}); 
	
	//$('.load-p1').width(0).height(_rate*27).css({"top":_rate*435, "left":_rate*220});
	var _scrollCheck=true; 
    $(window).scroll(function () {
        if(false == _scrollCheck){return;}  
        var scrollTop = $(this).scrollTop();  
        var scrollHeight = $(document).height();  
        var windowHeight = $(this).height(); 
        var _this= $(this);
        if (scrollTop + windowHeight > scrollHeight-10) {  //滚动到底部执行事件  
                console.dir("bottom");
                window.setTimeout(function(){
                	$(".home").fadeOut(function(){
                		_this.scrollTop(0);
                        $(".p2").fadeIn();
                    });
                    }, 200); 
                _scrollCheck=false;
        }  
        if (scrollTop == 0) {  //滚动到头部部执行事件  
            console.dir("top"); 
        }  
     });  

    function _popmsg(msg){
    	$(".weui-msg").html(msg);$(".js_dialog").show();
    }
    $('.u-submit').click(function(){
        var _phone=$("#u-phone").val();
        var _name=$("#u-name").val();
        var _sheng=$("#sheng").val();
        var _shi=$("#shi").val();
    	if('' == _phone){_popmsg('请您输入电话');return;} 
    	if('' == _name){_popmsg('请您输入姓名');return;}
    	if('' == _sheng){_popmsg('请您选择省');return;}
    	if('' == _shi){_popmsg('请您选择市');return;}

    	$.post("./api/?c=u", {phone:_phone,name:_name,sheng:_sheng,shi:_shi}, function(data){
       	  
   	    }, "json");
    	 

    }); 

    $(".js_dialog").click(function(){
        $(".js_dialog").hide();
	 }); 	
	 
	 
});
</script></body></html>